#!/usr/bin/perl
#
#
while($line=<STDIN>) {
	chomp($line);
	if($line=~/TRAIN NODE/) {
		$broke = -1;
	}
	elsif($line=~/UnReacha/) {
		$unReachable ++;
		$analysis{$broke}++;
	}
	elsif($line=~/\?\? True/) {
		$broke++;	
	}
	elsif($line=~/\?\? False/) {
		$broke++;
	}
}

foreach $key (sort {$a<=>$b} keys %analysis) {
	print $key."\t".$analysis{$key}."\n";
}
print "Total:\t".$unReachable."\n";

